import { createApp } from 'vue'
import App from './App.vue'
import router from './router'


let instance:any = null 

function render (){
    instance = createApp(App).use(router).mount('#app')
}

if(!(window as any).__MICRO_WEB__) {
    console.log(1111111)
    render()
}

export async function bootstrap (){
    console.log('vue3 app bootstraped')
}

export async function unmount (ctx:any){
    instance?.unmount()
    instance = null
    console.log('vue3 app unmounted')
    const {container} = ctx
    if(container){
        document.querySelector(container).innerHTML = ''
    }
}